package com.googlecode.adaboost.module;

import com.googlecode.adaboost.classifier.BinaryWeakClassifier;
import com.googlecode.adaboost.classifier.RealWeakClassifier;
import com.googlecode.adaboost.exception.AdaBoostException;
import com.googlecode.adaboost.trainer.AdaBoostConfiguration;

public class ModuleGenerator {

	protected ModuleLoader loader;

	public ModuleGenerator(AdaBoostConfiguration settings) {
		loader = new ModuleLoader(settings);
	}

	public BinaryWeakClassifier generateBinaryWeakClassifier()
			throws AdaBoostException {
		BinaryWeakClassifier weakClassifier = (BinaryWeakClassifier) loader
				.loadModule("weak-classifier", BinaryWeakClassifier.class);
		return weakClassifier;
	}

	public RealWeakClassifier generateRealWeakClassifier()
			throws AdaBoostException {
		RealWeakClassifier weakClassifier = (RealWeakClassifier) loader
				.loadModule("weak-classifier", RealWeakClassifier.class);
		return weakClassifier;
	}
}
